<?php $this->pageTitle = 'Create ' . $invoice->invoice_type_code; ?>
<?php Yii::app()->publishAndRegisterScriptFile(Yii::app()->basePath . '/javascripts/app.invoice.update.js'); ?>
<?php Yii::app()->publishAndRegisterScriptFile(Yii::getPathOfAlias('common') . '/javascripts/app.widgets.chooseContact.js'); ?>
<?php Yii::app()->publishAndRegisterScriptFile(Yii::getPathOfAlias('common') . '/javascripts/app.widgets.searchpostcode.js'); ?>
<?php Yii::app()->publishAndRegisterScriptFile(Yii::getPathOfAlias('common') . '/javascripts/app.widgets.searchBillableParty.js'); ?>
<?php
$this->breadcrumbs = array(
	Yii::t('app', $invoice->invoice_type_code . '|' . $invoice->invoice_type_code . 's', 2) => array('/invoice/index', 'invoice_type' => $invoice->invoice_type_code),
	'New ' . $invoice->invoice_type_code 
);
?>

<div class="main-title no-border clearfix">
	<h1 class="float-left">New <?php echo $invoice->invoice_type_code; ?></h1>
</div>
<div class="flat_area">
    <div id="ps-invoice-create" class="relative">
		<?php
		$this->renderPartial('_form', array(
			'agency' => $agency,
			'invoice' => $invoice,
			'invoiceItems' => $invoiceItems,
			'newInvoiceItem' => $newInvoiceItem,
			'propertyCaseId' => $propertyCaseId,
			'propertyCaseBillToPartyId' => $propertyCaseBillToPartyId,
			'propertyCaseBillToName' => $propertyCaseBillToName,
			'propertyCaseBillto' =>$propertyCaseBillto,
			'model' => $model
		));
		?>
    </div>
</div>
<?php
echo $this->renderPartial('_addContact', array(
	'contact' => $newContact
));
?>
<?php
echo $this->renderPartial('_editContact', array(
	'contact' => $contact
));
?>
<?php
$this->renderPartial('_dialog_chooseTransaction', array(
	'dataProvider' => $dataProvider,
	'propertyCaseSearch' => $propertyCaseSearch
));
?>

<?php
$this->renderPartial('_dialog_chooseParty', array(
	'searchContact' => $searchContact,
	'searchAgent' => $searchAgent,
	'searchAgency' => $searchAgency,
	'contactDataProvider' => $contactDataProvider,
	'agentDataProvider' => $agentDataProvider,
	'agencyDataProvider' => $agencyDataProvider
));
?>
